import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import CategoryEdit from '../components/CategoryEdit.vue'
import CategoryList from '../components/CategoryList.vue'
import VideoEdit from '../components/VideoEdit.vue'
import VideoList from '../components/VideoList.vue'
import UserEdit from '../components/UserEdit.vue'
import UserList from '../components/UserList.vue'
import AdEdit from '../components/AdEdit.vue'
import AdList from '../components/AdList.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',

    component: Main,
    children: [
      {
        path: '/category/create',
        component: CategoryEdit
      },
      {
        path: '/category/edit/:id',
        component: CategoryEdit,

        props: true
      },
      {
        path: '/category/list',
        component: CategoryList
      },

      {
        path: '/video/create',
        component: VideoEdit
      },
      {
        path: '/video/edit/:id',
        component: VideoEdit,
        props: true
      },
      {
        path: '/video/list',
        component: VideoList
      },

      {
        path: '/user/create',
        component: UserEdit
      },
      {
        path: '/user/edit/:id',
        component: UserEdit,
        props: true
      },
      {
        path: '/user/list',
        component: UserList
      },

      {
        path: '/ad/create',
        component: AdEdit
      },
      {
        path: '/ad/edit/:id',
        component: AdEdit,
        props: true
      },
      {
        path: '/ad/list',
        component: AdList
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
